<template>
  <section class="contact-section">
    <div class="container">
      <!-- 页面头部 -->
      <div class="contact-header">
        <h1 class="contact-title">CONTACT US</h1>
      </div>
      
      <!-- 联系信息网格 -->
      <div class="contact-grid">
        <!-- 电话卡片 -->
        <div class="contact-card" @click="handlePhoneClick">
          <div class="card-icon">📞</div>
          <h3 class="card-title">Tel</h3>
          <p class="card-content">0571-22222222</p>
        </div>
        
        <!-- 传真卡片 -->
        <div class="contact-card">
          <div class="card-icon">📠</div>
          <h3 class="card-title">Fax</h3>
          <p class="card-content">0571-22222222</p>
        </div>
        
        <!-- 邮箱卡片 -->
        <div class="contact-card" @click="handleEmailClick">
          <div class="card-icon">✉️</div>
          <h3 class="card-title">E-mail</h3>
          <p class="card-content">contact@company.com</p>
        </div>
        
        <!-- 地址卡片 -->
        <div class="contact-card contact-card-address" @click="handleAddressClick">
          <div class="card-icon">📍</div>
          <h3 class="card-title">Address</h3>
          <p class="card-content">Xihu District, Zhejiang, China</p>
        </div>
      </div>
    </div>
  </section>
</template>

<script setup lang="ts">
// 点击功能处理
const handlePhoneClick = () => {
  window.location.href = 'tel:0571-22222222';
};

const handleEmailClick = () => {
  window.location.href = 'mailto:contact@company.com';
};

const handleAddressClick = () => {
  // 打开地图应用（可以根据需要调整为具体的地图服务）
  const address = encodeURIComponent('Xihu District, Zhejiang, China');
  window.open(`https://maps.google.com/maps?q=${address}`, '_blank');
};
</script>

<style scoped>
/* 整体容器样式 */
.contact-section {
  min-height: 100vh;
  background-color: #f8f9fa;
  padding: 40px 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* 页面头部样式 */
.contact-header {
  text-align: center;
  margin-bottom: 40px;
}

.contact-title {
  font-size: 32px;
  font-weight: bold;
  color: #2c3e50;
  margin: 0;
  letter-spacing: 2px;
}

/* 联系信息网格布局 */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

/* 联系信息卡片样式 */
.contact-card {
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 地址卡片特殊样式 */
.contact-card-address {
  grid-column: 1 / -1;
}

/* 卡片内部元素样式 */
.card-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 16px;
  font-weight: bold;
  color: #495057;
  margin: 10px 0;
}

.card-content {
  font-size: 14px;
  color: #6c757d;
  margin: 0;
  line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 1023px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .contact-card-address {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .contact-section {
    padding: 20px 15px;
  }
  
  .contact-title {
    font-size: 24px;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 30px;
  }
  
  .contact-card-address {
    grid-column: 1;
  }
}

/* 可访问性增强 */
.contact-card:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

.contact-card:active {
  transform: translateY(0);
}
</style>